package com.nondo.rdp.finance.repository.collection;

import com.nondo.rdp.finance.domain.collection.CollList;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.Optional;

public interface CollListRepository extends JpaRepository<CollList, Long>, JpaSpecificationExecutor<CollList> {
    @Query("select a from CollList a where a.id=:id")
    Optional<CollList> findOne(@Param("id") int id);

    CollList save(CollList collList);

    CollList findByAlbumId(int albumId);
}
